export function getParentUntil(elmNode: HTMLElement, matchSelector: string): HTMLElement {
    if (elmNode.tagName.toLowerCase() === "body") {
        return null;
    }
    if (elmNode.matches(matchSelector)) {
        return elmNode;
    }
    return getParentUntil(elmNode.parentElement, matchSelector);
}